#include <QtPlugin>

#include <QVBoxLayout>
#include <QSpinBox>
#include <QWidget>
#include <QComboBox>
#include <QHBoxLayout>

#include <opencv/cv.h>
#include <opencv/highgui.h>

#include <iostream>

#include "QCVModuleInterface.h"
#include "QCVModuleHandlerInterface.h"

#ifndef MODULE_MORPHO
#define MODULE_MORPHO

class ModuleMorpho:public QObject,QCVModuleInterface
{
  Q_OBJECT
	Q_INTERFACES(QCVModuleInterface)
	
	public:
		void init(QCVModuleHandlerInterface * parent);
		void free();

		cv::Mat & process();
		void setInput(int n,const cv::Mat & m);

		QWidget* widget();
		QString getName();
		int nbInputs();
		QString help(int id);
		bool setParams(QString params);
    QString getParams();

		QCVModuleInterface * clone();

	private:  
    QWidget * win;
    QVBoxLayout * layout;

		QComboBox * cb_operation;
		QSpinBox * sb_kernelW,*sb_kernelH;
		QSpinBox * sb_iterations;

		cv::Mat image;

		QCVModuleHandlerInterface * parent;
};

#endif
